/**
 * 用户信息
 */
var mongoose = require('../db.js'),
    Schema = mongoose.Schema;

var UserSchema = new Schema({
    name: { type: String, default: '' },                    //用户账号
    password: { type: String, default: '' },                //密码
    email: { type: String, default: '' },                   //邮箱  
    age: { type: Number, default: '' },                     //年龄
    created: { type: Date, default: Date.now },             //创建时间
    autoToken: { type: String, default: '' }
});

/**
 * methods
 */
UserSchema.methods = {

    addUser: function (user, cb) {
        return this.save(user, cb)
    }

}

UserSchema.static = {
    load: function () {

    }
}

module.exports = mongoose.model('User', UserSchema);